* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root {
    --primary: #FF9494;
    --primary-dark: #FF7070;
    --secondary: #FFCDA8;
    --accent: #FFAEC8;
    --background: #FFF6F6;
    --card-bg: white;
    --text: #333;
    --shadow: rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --spacing: 16px;
}

body {
    background-color: var(--background);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 页面切换 */
.main-page, .favorites-page {
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
    padding: var(--spacing);
    height: 100vh;
    overflow-y: hidden;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}

.main-page.active, .favorites-page.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* 导航按钮 */
.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 112, 112, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 15;
    
    /* 固定在底部 */
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    width: 90%;
    margin: 0 auto;
    max-width: 440px;
}

.nav-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(255, 112, 112, 0.2);
}

.nav-button span {
    margin-right: 8px;
}

/* 返回按钮 */
.back-btn {
    background: none;
    border: none;
    color: var(--primary-dark);
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.favorites-page .header {
    justify-content: flex-start;
}

.favorites-page .header h1 {
    font-size: 20px;
    color: var(--primary-dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* 选择器样式 */
.pet-selector {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    gap: 10px;
}

.option-card {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px 10px;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.option-card.active {
    background-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(255, 148, 148, 0.3);
}

.option-card.active p,
.option-card.active .material-symbols-rounded {
    color: white;
}

.option-icon {
    margin-bottom: 8px;
}

.option-icon .material-symbols-rounded {
    font-size: 32px;
    color: var(--primary);
}

.option-card p {
    font-size: 14px;
    font-weight: 600;
}

/* 卡片容器 */
.card-container {
    position: relative;
    margin: 10px 0;
    padding-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.swipe-instruction {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    opacity: 0.7;
    font-size: 14px;
}

.swipe-arrow {
    display: flex;
    align-items: center;
    gap: 5px;
}

.swipe-arrow.left {
    color: #888;
}

.swipe-arrow.right {
    color: var(--primary-dark);
}

.cards {
    position: relative;
    width: 100%;
    flex: 1;
}

.pet-card {
    position: relative;
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    background-color: white;
    transition: transform 0.3s ease;
    will-change: transform;
    touch-action: none;
    z-index: 5;
    margin-bottom: 5px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.pet-card.swiping {
    transition: none;
    position: absolute;
    top: 0;
    left: 0;
}

.pet-card.removed {
    display: none;
}

.pet-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    background-color: #f8f8f8;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

.pet-info {
    position: relative;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f0f0f0;
}

.pet-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pet-type .material-symbols-rounded {
    color: var(--primary);
}

.pet-type h3 {
    font-size: 18px;
    font-weight: 600;
}

.like-badge, .nope-badge {
    position: absolute;
    top: 20px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 32px;
    transform: rotate(-20deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.like-badge {
    right: 20px;
    color: var(--primary);
    border: 4px solid var(--primary);
}

.nope-badge {
    left: 20px;
    color: #ccc;
    border: 4px solid #ccc;
}

.pet-card.like .like-badge,
.pet-card.nope .nope-badge {
    opacity: 1;
}

/* 卡片动作按钮 */
.card-actions {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    width: 90%;
    max-width: 440px;
    display: flex;
    justify-content: center;
    gap: 50px;
    z-index: 10;
}

.action-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-label {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.action-btn {
    width: 64px; /* 调整按钮尺寸 */
    height: 64px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px var(--shadow);
}

.skip-btn {
    background-color: white;
    border: 1px solid #eee; /* 添加边框增强视觉效果 */
}

.skip-btn .material-symbols-rounded {
    color: #ccc;
    font-size: 28px; /* 调整图标尺寸 */
}

.like-btn {
    background-color: var(--primary);
}

.like-btn .material-symbols-rounded {
    color: white;
    font-size: 28px; /* 调整图标尺寸 */
}

/* 收藏部分 */
.favorites-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.favorite-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1/1;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.favorite-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.favorite-item .remove-btn .material-symbols-rounded {
    font-size: 18px;
    color: var(--primary-dark);
}

/* 空收藏状态 */
.empty-favorites {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.empty-favorites.visible {
    display: flex;
}

.empty-favorites .material-symbols-rounded {
    font-size: 48px;
    color: var(--primary-dark);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-favorites p {
    line-height: 1.5;
}

/* 加载屏幕 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.visible {
    opacity: 1;
    pointer-events: all;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 148, 148, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-screen p {
    color: var(--primary-dark);
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 给卡片添加一些动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pet-card {
    animation: fadeIn 0.3s ease;
}

/* 媒体查询 */
@media (max-width: 350px) {
    .option-card {
        padding: 12px 8px;
    }
    
    .option-icon .material-symbols-rounded {
        font-size: 28px;
    }
    
    .option-card p {
        font-size: 12px;
    }
    
    .card-container {
        height: 400px;
    }
}

/* 添加滑动过渡效果 */
.transition-like {
    transform: translate(150%, 0) rotate(45deg) !important;
}

.transition-nope {
    transform: translate(-150%, 0) rotate(-45deg) !important;
}

/* 预览模态框样式 */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.preview-modal.active {
    opacity: 1;
    visibility: visible;
}

.preview-content {
    width: 90%;
    max-width: 500px;
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.preview-modal.active .preview-content {
    transform: scale(1);
}

.preview-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 70vh;
}

.preview-actions {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background-color: white;
}

.preview-close, .preview-download {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.preview-close {
    color: #ff5252;
}

.preview-download {
    color: #4caf50;
    border-radius: 20px;
    gap: 5px;
}

.preview-close:hover, .preview-download:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 长按提示样式 */
.long-press-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.long-press-hint.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.long-press-hint::before {
    content: "\e90d";
    font-family: 'Material Symbols Rounded';
    margin-right: 8px;
    font-size: 18px;
}

/* 确保收藏项目有正确的定位 */
.favorite-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.favorite-item:hover {
    transform: scale(1.03);
}

/* 处理底部空间，避免内容被固定按钮遮挡 */
.main-page {
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 手机版适配 */
@media (max-width: 480px) {
    .card-actions {
        bottom: 90px;
    }
    
    .nav-button {
        bottom: 15px;
    }
}

/* 确保导航按钮居中 */
#show-favorites {
    left: 50%;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
}

/* 在收藏页面可以滚动 */
.favorites-page {
    overflow-y: auto;
} 